//		ID : Xerxes
//      "I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define fo(i,st,ed) for(int i = st ; i < ed ; ++i )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int int
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )
#define tp pair< int, pair<int,int> >
#define mmk( x, y , z ) mk( x, mk( y, z ) )

inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}

//**********************************************
const int inf = (int)800;
Int parent[ inf+10 ];
Int rank[ inf+10 ];

inline void _Make(){
    int i;
    for(i=0;i<inf;++i){
        parent[i]=i;
        rank[i]=0;
    }
}
inline Int _Find(Int now_node){
    
    if( now_node != parent[ now_node ] ){
        parent[ now_node ] = _Find(  parent[now_node] );
    }
return parent[ now_node ];
}
inline void _Union(Int node_x, Int node_y ){
    
    Int parent_x = _Find( node_x );
    Int parent_y = _Find( node_y );

    if( rank[ parent_x ] > rank[ parent_y ] ){
        parent[ parent_y ] = parent_x;
    }
    else{
        parent[ parent_x ] = parent_y;
    }
    if( rank[ parent_x ] == rank [ parent_y ] ){
        rank[ parent_y ]+=1;
    }
}

//**********************************************

string line="";
int n,e;
struct NODE{
	int x,y;
	double d;
	NODE(int x_, int y_, double d_):
	x(x_),y(y_),d(d_){;}
};
inline bool cmp( NODE A, NODE B ){
	return ( (A.d - B.d) < 1e-9 );
}
vector< NODE > edges;
inline void Read(){
		CI(n);
		VI x(n,0),y(n,0);
		fo(i,0,n){
			CI(x[i]);
			CI(y[i]);
		}
		edges.clear();
		fo(i,0,n){
			fo(j,i+1,n){
				double d = sqrt( (double)( (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]) )  );
				edges.pb( NODE(i+1,j+1,d) );
			}
		}
	
		//SORTING THE EDGES
		sort(edges.begin(),edges.end(), cmp);
}
inline void Proc(){
	
	_Make();
	int already_connected;
	CI(already_connected);
	int x,y;
	fo(i,0,already_connected){
		CI(x);
		CI(y);
		_Union(x,y);
	}
	cout<<line;
	bool come=false;
	for(int i=0,j=SZ(edges); i<j ; ++i ){
		int x = edges[i].x;
		int y = edges[i].y;
		//double d = edges[i].d; 
		
		if( _Find(x)!=_Find(y) ){
			_Union(x,y);
			come=true;
			cout<<x<<" "<<y<<"\n";
		}
	}
	
	
	if( come==false ){
		cout<<"No new highways need\n";
	}
	
}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("in","rt",stdin);
    #endif
    int cases=1;
    line="";
    for( CI(cases) ; cases ; --cases ){
        Read();
        Proc();
        line="\n";
    }

return 0;
}


